package org.hqs.feign.clients;

import org.hqs.feign.common.JsonResult;
import org.hqs.feign.pojo.Department;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "departmentservice")
public interface DepartmentClient {

    @GetMapping("/department/")
    public JsonResult<List<Department>>  getAllDepartments();

    @GetMapping("/department/{id}")
    public JsonResult<Department> getDepartmentById(@PathVariable Long id);

//    @GetMapping("/{id}")
//    public Department getDepartmentById(@PathVariable Long id) {
//        return departmentService.getDepartmentById(id);
//    }

    @PostMapping("/department/")
    public JsonResult saveDepartment(@RequestBody Department department);

    @PutMapping("/department/{id}")
    public JsonResult updateDepartment(@PathVariable Long id, @RequestBody Department department);

    @DeleteMapping("/department/{id}")
    public JsonResult deleteDepartment(@PathVariable Long id);
}
